import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ConversionRateQuery, ConversionRatePageResult } from "./types";

/**
 * 获取码分页数据
 *
 * @param queryParams
 */
export function getConversionRatePage(
  queryParams?: ConversionRateQuery
): AxiosPromise<ConversionRatePageResult> {
  return request({
    url: "/api/Order/OrderList",
    method: "post",
    data: queryParams,
    // params: queryParams,
  });
}

/**
 * 获取码分页数据
 *
 * @param queryParams
 */
export function getTotal(): AxiosPromise<ConversionRatePageResult> {
  return request({
    url: "/api/Order/Today",
    method: "post",
  });
}
/**
 * 获取码分页数据
 *
 * @param queryParams
 */
export function getHour(): AxiosPromise<ConversionRatePageResult> {
  return request({
    url: "/api/Order/Hour",
    method: "post",
  });
}
/**
 * 获取码下拉数据
 *
 * @param queryParams
 */
export function getConversionRateOptions(
  queryParams?: ConversionRateQuery
): AxiosPromise<OptionType[]> {
  return request({
    url: "/api/v1/roles/options",
    method: "get",
    params: queryParams,
  });
}
